// components/navigation-item/navtar.js
const util = require('../../utils/util.js')
const {
  request
} = require("../../utils/index.js")
const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    tabbar: {
      type: Object,
      value: {},
    },
    mess: {
      type: String,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    isIphoneX: app.globalData.systemInfo.model.search('iPhone X') != -1 ? true : false,
    show: false,
    certifi: '待认证', //用户实名认证状态
    userperf: '' //用户资料完善状态
  },
  attached() {
    app.editTabbar()
  },

  /**
   * 组件的方法列表
   */
  methods: {
    coopera: function (potions) {
      wx.navigateTo({
        url: '../../pages/recruitment/recruitcoopera',
      })
      // if (wx.getStorageSync('userinfo') != '') {
      // }else{
      //   wx.showModal({    
      //     title: '请先登录或完善信息与实名认证',
      //     confirmText: "确认",
      //     showCancel: false,
      //   })
      // }
    },
    share: function (potions) {
      wx.navigateTo({
        url: '../../pages/sharerelease/sharerelease',
      })
      // if (wx.getStorageSync('userinfo') != '') {
      // }else{
      //   console.log(321)
      //   wx.showModal({    
      //     title: '请先登录或完善信息与实名认证',
      //     confirmText: "确认",
      //     showCancel: false,
      //   })
      // }
    },
    Mutual: function (potions) {
      wx.navigateTo({
        url: '../../pages/Mutualrelease/Mutualrelease',
      })
      // if (wx.getStorageSync('userinfo') != '') {
      // }else{
      //   wx.showModal({    
      //     title: '请先登录或完善信息与实名认证',
      //     confirmText: "确认",
      //     showCancel: false,
      //   })
      // }
    },
    //活动组织跳转
    calledr: function (potions) {
      wx.navigateTo({
        url: '../../pages/calledrelease/calledrelease',
      })
      // if (wx.getStorageSync('userinfo') != '') {
      // }else{
      //   wx.showModal({    
      //     title: '请先登录或完善信息与实名认证',
      //     confirmText: "确认",
      //     showCancel: false,
      //   })
      // }
    },
    release: function () {
      wx.navigateTo({
        url: '../../pages/businrelesae/businrelesae',
      })
      // if (wx.getStorageSync('userinfo') != '') {
      // }else{
      //   wx.showModal({    
      //     title: '请先登录或完善信息与实名认证',
      //     confirmText: "确认",
      //     showCancel: false,
      //   })
      // }
    },
    //获得用户个人信息状态
    async getuserinfo() {
      let token = wx.getStorageSync('token')
      let par = {
        url: "hw/portal/user/self",
        method: "GET",
        data: {
          token: token
        },
        header: {
          'content-type': 'application/json', // 默认值
        },
      }
      let datainfo = await request(par);
      console.log(datainfo)
      if (datainfo.status == 100) {
        this.setData({
          certifi: datainfo.data.auditStatus
        })
      }
    },
    centerisshow() {
      this.setData({
        show: false
      })
    },
    Frostedglass() {
      this.setData({
        show: !this.data.show
      })
    }
  }
})